package com.zwj.service.impl;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.zwj.dao.ordermaster.ZOrderMasterMapper;
import com.zwj.entity.ZOrderMaster;
import com.zwj.service.ZOrderMasterService;


/**
 * <p>Title: OrderMasterServiceImpl</p>  
 * <p>Description: service层方法</p>  
 * @author  杰
 * @date  2019年6月10日
 */
@Service
@Transactional
public class ZOrderMasterServiceImpl implements ZOrderMasterService{

	@Autowired
	private ZOrderMasterMapper zOrderMasterMapper;

	//查询所有订单
	@Override
	public List<ZOrderMaster> selectAll() {
		List<ZOrderMaster> om = this.zOrderMasterMapper.selectAll();
		return om;
	}

	//查询单个订单
	@Override
	public List<ZOrderMaster> selectOne(Map<String,Object> map) {
		List<ZOrderMaster> om = this.zOrderMasterMapper.selectOne(map);
		return om;
	}
		
	//删除订单
	@Override
	public boolean deleteOrderMaster(@Param("buyer_name")String buyer_name) {
		return this.zOrderMasterMapper.deleteOrderMaster(buyer_name);
	}

	//依据buyer_name查询
	@Override
	public ZOrderMaster selectBybuyer_name(String buyer_name) {
		ZOrderMaster om = this.zOrderMasterMapper.selectBybuyer_name(buyer_name);
		return om;
	}

	//模糊查询
	@Override
	public List<ZOrderMaster> selectByLikeOrderMaster(ZOrderMaster orderMaster) {
		List<ZOrderMaster> om = this.zOrderMasterMapper.selectByLikeOrderMaster(orderMaster);
		return om;
	}

	//修改收货地址
	@Override
	public boolean updateAddress(ZOrderMaster orderMaster) {
		boolean result = this.zOrderMasterMapper.updateAddress(orderMaster);
		return result;
	}

	//依据buyer_name模糊查询
	@Override
	public List<ZOrderMaster> selectByLikebuyer_name(String buyer_name) {
		List<ZOrderMaster> lom = this.zOrderMasterMapper.selectByLikebuyer_name(buyer_name);
		return lom;
	}

	@Override
	public int addOrderMaster(ZOrderMaster orderMaster) {
		return this.zOrderMasterMapper.addOrderMaster(orderMaster);
	}

	@Override
	public boolean upStatus(int order_id) {
	
		return this.zOrderMasterMapper.upStatus(order_id);
	
	}

	

	
	
	

}
